package com.sl.core.engine.meta.valuemeta;

import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.plugins.Plugin;
import org.apache.hop.core.plugins.PluginRegistry;
import org.apache.hop.core.row.value.ValueMetaPluginType;

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.stream.Collectors;


public class FieldTypeValueMetaCollect {


    public static List<Map<String, Object>> getFieldType() {
        List<Plugin> plugins = PluginRegistry.getInstance().getPlugins(ValueMetaPluginType.class);

        List<Map<String, Object>> collect = plugins.stream()
                .filter(v -> !v.getName().equals("Array")).map(v -> {
                    Map<String, Object> map = Maps.newHashMap();
                    map.put("code", v.getName());
                    map.put("name", v.getName());
                    return map;
                }).collect(Collectors.toList());
        return collect;

    }

}
